﻿#pragma once

#include <QtGui>
#include <QtCore>
#include <QtWidgets>
#include <QtWebEngineWidgets>

struct DesktopInfo {
    QScreen *screen = nullptr;
    QWebEngineView *webview = nullptr;

    QString file;
    QPoint pos;
};

class ZShellDesktopViewer : public QObject {
    Q_OBJECT
public:
    ZShellDesktopViewer();
    ~ZShellDesktopViewer();

protected:
    void createViews();
    void updateViews();
    int screensOffset();

protected:
    void timerEvent(QTimerEvent *e);

private:
    QList<DesktopInfo> infos_;
    int timerCheckDesktop_ = 0;
    QSystemTrayIcon tray_;
    QMenu *menu_ = new QMenu();
};

